package gemini.castor.ui.client.utils;

import java.util.ArrayList;
import java.util.List;


public class PlaceConstants {
	
	// Layout position
	public static enum LayoutPosition {
		HEADER, FOOTER, NAVIGATION, CONTENT, CONTEXT, MENU;
	}
	
	// Menu item
	public static enum MenuItem {
		HOME("mniHome"),
		ACCOUNT("mniAccount"),
		OFFICE("mniOffice"),
		CUSTOMER("mniCustomer"),
		TRAINING("mniTraining"),
		STORE("mniStore");
		
		String textKey;

		MenuItem(String textKey){
			this.textKey = textKey;
		}

		public String getTextKey() {
			return textKey;
		}
		
		public static MenuItem getFromTextKey(String textKey){
			for (MenuItem item : MenuItem.values()) {
				if(item.textKey.equals(textKey)){
					return item;
				}
			}
			return null;
		}
	}

	
	
	// Navigation item
	public static enum NavigationItem {
		
		// Home
		REGISTER("nviUserRegister", PLACE_REGISTER),
		APPLY("nviDistributorApply", PLACE_APPLY),
		FIND_SOMEONE("nviFindSomeOne", PLACE_FIND_SOMEONE),
		
		// Account
		ACCOUNT_INFO("nviAccountInfo", PLACE_ACCOUNT_INFO),
		VOLUME_POINT("nviVolumePoint", PLACE_VOLUME_POINT),
		MY_ORDER("nviMyOrder", PLACE_MY_ORDER),
		MY_DOWNLINE("nviMyDownline", PLACE_MY_DOWNLINE),
		MY_SPONSOR("nviMySponsor", PLACE_MY_SPONSOR),
		
		// Office
		EVENTS("nviEvents", PLACE_EVENTS),
		MY_STORY("nviMyStory", PLACE_MY_STORY),
		MESSAGE_CENTER("nviMessageCenter", PLACE_MESSAGE_CENTER),
		PROMOTIONS("nviPromotions", PLACE_PROMOTIONS),
		RECOGNITIONS("nviRegconitions", PLACE_RECOGNITIONS),
		NEWS("nviNews", PLACE_NEWS),
		TODO_LIST("nviTodoList", PLACE_TODO_LIST),
		
		// Customer
		CUSTOMER_INFO("nviCustomerInfo", PLACE_CUSTOMER_INFO),
		CUSTOMER_LIST("nviCustomerList", PLACE_CUSTOMER_LIST),
		CARE_SCHEDULE("nviCareSchedule", PLACE_CARE_SCHEDULE),
		
		// Training
		SUCCESS_STORIES("nviSuccessStories", PLACE_SUCCESS_STORIES),
		STEP_BY_STEP("nviStepByStep", PLACE_STEP_BY_STEP),
		ABOUT_COMPANY("nviAboutCompany", PLACE_ABOUT_COMPANY),
		ABOUT_PRODUCT("nviAboutProduct", PLACE_ABOUT_PRODUCT),
		MARKETING_PLAN("nviMarketingPlan", PLACE_MARKETING_PLAN),
		BUSINESS_METHODS("nviBusinessMethods", PLACE_BUSINESS_METHODS),
		LIBRARY("nviLibrary", PLACE_LIBRARY),
		
		// Store
		PRICE_LIST("nviPriceList", PLACE_PRICE_LIST),
		PRODUCT_DETAIL("nviSearchProduct", PLACE_SEARCH_PRODUCT),
		PRODUCT_CATALOG("nviProductCatalog", PLACE_CATALOG),
		SHOPPING_CART("nviShoppingCart", PLACE_SHOPPING_CART);
	
		String textKey;
		String placeId;

		NavigationItem(String textKey, String placeId){
			this.textKey = textKey;
			this.placeId = placeId;
		}

		public String getTextKey() {
			return textKey;
		}
		
		public String getPlaceId() {
			return placeId;
		}
		
		public static NavigationItem getFromTextKey(String textKey){
			for (NavigationItem item : NavigationItem.values()) {
				if(item.textKey.equals(textKey)){
					return item;
				}
			}
			return null;
		}
	}
	
	// Navigation items for Home menu
	public static List<NavigationItem> homeNavigationItems = new ArrayList<NavigationItem>(){

		private static final long serialVersionUID = 1L;

		{
			add(NavigationItem.FIND_SOMEONE);
			add(NavigationItem.APPLY);
			add(NavigationItem.REGISTER);
		}
	};
	
	// Navigation items for Home menu
	public static List<NavigationItem> accountNavigationItems = new ArrayList<NavigationItem>(){

		private static final long serialVersionUID = 1L;

		{
			add(NavigationItem.ACCOUNT_INFO);
			add(NavigationItem.VOLUME_POINT);
			add(NavigationItem.MY_ORDER);
			add(NavigationItem.MY_DOWNLINE);
			add(NavigationItem.MY_SPONSOR);
		}
	};
	
	// Navigation items for Home menu
	public static List<NavigationItem> officeNavigationItems = new ArrayList<NavigationItem>(){

		private static final long serialVersionUID = 1L;

		{
			add(NavigationItem.EVENTS);
			add(NavigationItem.MY_STORY);
			add(NavigationItem.MESSAGE_CENTER);
			add(NavigationItem.PROMOTIONS);
			add(NavigationItem.RECOGNITIONS);
			add(NavigationItem.NEWS);
			add(NavigationItem.TODO_LIST);
		}
	};
	
	// Navigation items for Home menu
	public static List<NavigationItem> customerNavigationItems = new ArrayList<NavigationItem>(){

		private static final long serialVersionUID = 1L;

		{
			add(NavigationItem.CUSTOMER_LIST);
			add(NavigationItem.CUSTOMER_INFO);
			add(NavigationItem.CARE_SCHEDULE);
		}
	};
	
	// Navigation items for Home menu
	public static List<NavigationItem> trainingNavigationItems = new ArrayList<NavigationItem>(){

		private static final long serialVersionUID = 1L;

		{
			add(NavigationItem.SUCCESS_STORIES);
			add(NavigationItem.STEP_BY_STEP);
			add(NavigationItem.ABOUT_COMPANY);
			add(NavigationItem.ABOUT_PRODUCT);
			add(NavigationItem.MARKETING_PLAN);
			add(NavigationItem.BUSINESS_METHODS);
			add(NavigationItem.LIBRARY);
		}
	};
	
	// Navigation items for Home menu
	public static List<NavigationItem> storeNavigationItems = new ArrayList<NavigationItem>(){

		private static final long serialVersionUID = 1L;

		{
			add(NavigationItem.PRICE_LIST);
			add(NavigationItem.PRODUCT_DETAIL);
			add(NavigationItem.PRODUCT_CATALOG);
			add(NavigationItem.SHOPPING_CART);
		}
	};
	
	// Screen Place
	public static final String PLACE_ROOT = "Root";
	
	public static final String PLACE_USER = "User";
	public static final String PLACE_USER_LOGIN = "UserLogin";
	public static final String PLACE_USER_INFO = "UserInfo";

	public static final String PLACE_REGISTER = "Register";
	public static final String PLACE_APPLY = "Apply";	
	public static final String PLACE_FIND_SOMEONE = "FindSomeOne";
	
	public static final String PLACE_ACCOUNT_INFO = "AccountInfo";
	public static final String PLACE_VOLUME_POINT = "VolumePoint";
	public static final String PLACE_MY_ORDER = "MyOrder";
	public static final String PLACE_MY_DOWNLINE = "MyDownLine";
	public static final String PLACE_MY_SPONSOR = "MySponsor";
	
	public static final String PLACE_MY_STORY = "MyStory";
	public static final String PLACE_MESSAGE_CENTER = "MessageCenter";
	public static final String PLACE_EVENTS = "Events";
	public static final String PLACE_PROMOTIONS = "Promotions";
	public static final String PLACE_RECOGNITIONS = "Recognitions";
	public static final String PLACE_NEWS = "News";
	public static final String PLACE_TODO_LIST = "TodoList";
	public static final String PLACE_NOTES = "Notes";
	
	public static final String PLACE_CUSTOMER_INFO = "CustomerInfo";
	public static final String PLACE_CUSTOMER_LIST = "CustomerList";
	public static final String PLACE_CARE_SCHEDULE = "CareSchedule";
	
	public static final String PLACE_SUCCESS_STORIES = "SuccessStories";
	public static final String PLACE_STEP_BY_STEP = "StepByStep";
	public static final String PLACE_ABOUT_COMPANY = "AboutCompany";
	public static final String PLACE_ABOUT_PRODUCT = "AboutProduct";
	public static final String PLACE_MARKETING_PLAN = "MarketingPlan";
	public static final String PLACE_BUSINESS_METHODS = "BusinessMethods";
	public static final String PLACE_LIBRARY = "Library";
	
	public static final String PLACE_PRICE_LIST = "PriceList";
	public static final String PLACE_SEARCH_PRODUCT = "SearchProduct";
	public static final String PLACE_CATALOG = "ProductCatalog";
	public static final String PLACE_SHOPPING_CART = "ShoppingCart";

	//TODO: HNO, temporary item used in prototype
	public static final String PLACE_WELCOME = "Tempo";
}